<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>
    //定时器 1：一次性定时器
    var a = setTimeout(function(){
          console.log(11)
    },1000)
    //销毁 
    clearTimeout(a)
    //定时器 2:循环定时器
    var b = setInterval(function(){
        console.log('执行一次')
    },2000)
    clearInterval(b)
</script>
</body>
</html>